	
--[[
	
	In BGs
	- Keep track of friendly and enemy unit names
	- Send the spell cast event via name, rather than GUID
	
	Widget
	- The widget will keep track of names, but not actually display anything
	
	function ShowSpellFromGUID(caster, spell, displayName, icon, startTime, endTime, notInterruptible, channel)
	function ShowSpellFromPointer(nameplate, spell, displayName, icon, startTime, endTime, notInterruptible, channel)
	
	The Widget will keep track of names in BGs and Arenas, and watch for names in spell cast events, and send the 
	cast request to ShowSpellFromPointer().
	
	In raids, etc, the Widget will keep track of GUIDs, and possibly boss names.
	
--]]

local function UpdateWidget(self, unit)
	
end

local function CreateWidget(parent)
	local frame = CreateFrame("Frame", nil, parent)

	return frame
end




	-- [[	
-------------------------------------------------------------------------
-- Spell Cast Event Watcher.
-------------------------------------------------------------------------
if not useDefaultCastbar then
	local CombatCastEventWatcher = CreateFrame("Frame")
	local CombatEventHandlers = {}

	function CombatEventHandlers.SPELL_CAST_START(...)
		local timestamp, combatevent, sourceGUID, sourceName, sourceFlags, destGUID, destName, destFlags, spellid, spellname = ...
		local currentTime = GetTime()
		local spell, _, icon, _, _, _, castTime, _, _ = GetSpellInfo(spellid)
		--print("COMBAT_LOG_SPELL_CAST_START", sourceGUID, sourceName, spell, destName)
		if castTime then ShowSpellFromGUID(sourceGUID, spell, icon, currentTime, currentTime + (castTime/1000), false) end
		
		-- Reference the GUID to determine interuptability of currentunit
		-- name, subText, text, texture, startTime, endTime, isTradeSkill, castID, notInterruptible = UnitCastingInfo("unit")
		
		-- SPELL_CAST_SUCCESS
		-- 
		--name, subText, text, texture, startTime, endTime, isTradeSkill, notInterruptible = UnitChannelInfo("unit")
		
		-- http://www.wowwiki.com/API_COMBAT_LOG_EVENT
	end
	
	function CombatEventHandlers.UNIT_SPELLCAST_START(...)
	
	end
	
	function OnCombatEvent(self, event, ...)
		if event == "COMBAT_LOG_EVENT_UNFILTERED" then
			local timestamp, combatevent = ...
			if CombatEventHandlers[combatevent] then CombatEventHandlers[combatevent]( ...) end
		else
			if CombatEventHandlers[event] then CombatEventHandlers[event](...) end
			local unitid, spell = ...
			--print(event, unitid, UnitName(unitid), spell)
		end
	end

	CombatCastEventWatcher:SetScript("OnEvent", OnCombatEvent) 
	CombatCastEventWatcher:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED");
	CombatCastEventWatcher:RegisterEvent("UNIT_SPELLCAST_START");
	CombatCastEventWatcher:RegisterEvent("UNIT_SPELLCAST_STOP");
	CombatCastEventWatcher:RegisterEvent("UNIT_SPELLCAST_INTERRUPTIBLE");
	CombatCastEventWatcher:RegisterEvent("UNIT_SPELLCAST_NOT_INTERRUPTIBLE");
end
--]]	